package team.szm.scd.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;
import team.szm.scd.database.entity.Department;
import team.szm.scd.database.mapper.DepartmentMapper;
import team.szm.scd.service.interfaces.IDepartmentService;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DepartmentServiceImpl implements IDepartmentService {
    @Resource
    DepartmentMapper mapper;

    @Override
    public List<Department> departmentsHospitalHave(Integer hospitalId) {
        QueryWrapper<Department> wrapper = new QueryWrapper<>();
        wrapper.eq("hid", hospitalId);
        return mapper.departmentsFromQueryWrapper(wrapper);
    }
}
